﻿@model DistanceLearning.Models.RegisterModel

<script src="~/Scripts/jquery-1.7.1.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>

@{
    var ajaxOptions = new AjaxOptions
                          {
                              UpdateTargetId = "user_details",
                              InsertionMode = InsertionMode.Replace,
                              HttpMethod = "POST",
                          }; }

@using (Ajax.BeginForm("Register", ajaxOptions)) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.Password)
    @Html.HiddenFor(model => model.ConfirmPassword)
    <fieldset>
        <legend>Регистрация нового пользователя</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PatronymicName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PatronymicName)
            @Html.ValidationMessageFor(model => model.PatronymicName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DateOfBirth)
        </div>
        <input type="date" id="DateOfBirth" name="DateOfBirth" />
        
        <div class="editor-label">
            @Html.LabelFor(model => model.SendEmail)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SendEmail)
        </div>
        <input type="submit" value="Создать" />
    </fieldset>
}